(function (window, undefined) {
    "use strict";

    if (typeof window.utils !== "object" && typeof window.utils !== "function") {
        window.utils = {};
    }

    /**
     * Determines whether its argument is a number.
     *
     * @param {any} value - The value to be tested.
     * @return true if the value is a numeric value.
     */
    utils.isNumeric = function(value) {
        var result = null;

        if (jQuery) {
            if (jQuery.isNumeric) {
                result = jQuery.isNumeric(value);
            } else if (jQuery.isNaN) {
                result = (jQuery.isNaN(value) === false);
            }
        }

        if (result === null) {
            result = !isNaN(parseFloat(value)) && isFinite(value);
        }

        return result;
    };

    /**
     * Determines whether its argument is a number.
     *
     * @param {any} value - The value to be tested.
     * @return true if the value is a numeric value.
     */
    utils.replace = function(value) {
        var result = null;

        if (jQuery) {
            if (jQuery.isNumeric) {
                result = jQuery.isNumeric(value);
            } else if (jQuery.isNaN) {
                result = (jQuery.isNaN(value) === false);
            }
        }

        if (result === null) {
            result = !isNaN(parseFloat(value)) && isFinite(value);
        }

        return result;
    };

})(window);
